export function useTable() {
    const fileColumns: any = [
        { slots: { default: 'fileInfo' }, title: '附件信息' },
        { slots: { default: 'unit' }, title: '状态 ' },
        { slots: { default: 'operate' }, title: '操作', width: 300 },
    ]

    const gridOptions = reactive<any>({
        align: 'center',
        border: true,
        columnConfig: {
            resizable: true,
        },
        columns: [
            { slots: { default: 'info' }, title: '商品详情', width: 400 },
            { field: 'brand', title: '品牌' },
            { field: 'model', title: '型号' },
            { slots: { default: 'unit' }, title: '单价/单位' },
            { slots: { default: 'quantity' }, title: '本次下单数量', width: 120 },
            { slots: { default: 'total' }, title: '总价' },
            { slots: { default: 'operate' }, title: '操作', width: 300 },
        ],
        data: [],
        editConfig: {
            mode: 'row',
            showStatus: true,
            trigger: 'manual',
        },
        height: 530,
        keepSource: true,
        loading: false,
        showOverflow: false,
    })

    const btns = [
        {
            label: '删除',
            text: true,
            value: 'delete',
        },
    ]

    const toolBtn = [
        {
            label: '选择商品',
            value: 'select',
        },
        // 接口暂无
        {
            label: '导入商品',
            value: 'import',
        },
    ]

    const footBtn = [
        {
            label: '直接下单',
            value: 'add',
        },
    ]

    return { btns, fileColumns, footBtn, gridOptions, toolBtn }
}
